﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SystemDirectory.Biz;
using SystemDirectory.Common;
using System.Data;
using SystemDirectory.Entity;


namespace SystemDirectory
{
    public partial class ProgrammeDetails : System.Web.UI.Page
    {
        public static bool IsCheck = false;
        public static Utilities.SearchType IsSearch;
        protected void Page_Load(object sender, EventArgs e)
        {

            if (!Page.IsPostBack)
            {
                if (Request.QueryString["id"]!=null)
                {
                    BOProgramme boProgramme = new BOProgramme();
                    SystemDirectory.Entity.Programme pg = boProgramme.GetByID(Convert.ToInt32(Request.QueryString["id"].ToString()));
                    ProgrammeName.Text = pg.ProgrammeName;
                    Description.Text = pg.Description;

                }
                else
	            {
                    Response.Redirect("ProgrammeList.aspx");
	            }



            }


        }

        protected void saveProgramme_Click(object sender, EventArgs e)
        {
            Page.Validate("vgroup");
            if (Page.IsValid)
            {

                Programme pg = new Programme();
                pg.ProgrammeID = Convert.ToInt32(Request.QueryString["id"].ToString());
                pg.ProgrammeName = ProgrammeName.Text;
                pg.Description = Description.Text;
                BOProgramme boProgramme = new BOProgramme();
                pg.ProgrammeName = ProgrammeName.Text;
                pg.Description = Description.Text;
                
                boProgramme.UpdateProgramme(pg);
            }
        }

    }
}

